{% extends 'front/front_base.html' %}

{% block title %}
六月论坛-{{ article.article_title }}
{% endblock %}
{% block head %}
    <link rel="stylesheet" href="{{ url_for('static',filename='front/css/front_article_detail.css') }}">
{#    <script src="http://media.junpy.club/static-ueditor.config.js"></script>#}
    <script src="http://media.junpy.club/wangEditor.min.js"></script>
    <script src="{{ static('front/js/front_public_comment.js') }}"></script>
{% endblock %}
{% block content %}
{#    左边显示帖子内容的大盒子#}
<div class="lg-container">
    <div class="title-group">
        <h2>{{ article.article_title }}</h2>
        <div class="article-other">
            <span class="left pull-left">
                <span>作者:{{ article.author.username }}</span>
                <span>发表时间:{{ article.add_time }}</span>
                <span>所属板块:{{ article.board.board_name }}</span>
                <span>所属板块:{{ article.board.board_name }}</span>
            </span>
            <span class="right pull-right">
                <span>阅读数:0</span>
                <span>评论数:0</span>
            </span>
        </div>
    </div>
    <div class="detail">
    {{ article.article_content|safe }}
    </div>
{#    评论列表#}
    <div class="comment-list">
        <h3>评论列表</h3>
        {% for comment in article.front_comments %}
        <div class="comment-li">
            <span class="left-avatar">
                <img src="{{ comment.author.avatar }}" alt="">
            </span>
            <div class="right-info">
                <span class="comment-author"><a href="">{{ comment.author.username }}</a></span>
                <span class="bottom-time pull-right">评论时间:{{ comment.add_time }}</span>
                <div class="comment-detail">
                    {{ comment.content|safe }}
                </div>
            </div>
        </div>
        {% endfor %}
    </div>
{#    发表评论#}
    <div class="public-comment">
        <h3>发表评论</h3>
        <div>
            <div id="ueditor" class="toolbar"></div>
            <span class="btn btn-warning pull-right public-btn" data-article-id="{{ article.id }}">发表评论</span>
        </div>
    </div>
</div>
<div class="sm-container">
    <div class="user-info text-center">
        {% if g.front_user %}
        <div class="avatar">
            <img src="{{ g.front_user.avatar }}" alt="">
        </div>
        <div class="user-desc">
            <h3 class="username">{{ g.front_user.username }}</h3>
            <h5>{{ g.front_user.signature }}</h5>
        </div>
        {% else %}
        <div class="avatar">
            <img src="{{ url_for('static',filename='images/default_avatar.png') }}" alt="">
        </div>
        <div class="text-center user-desc">
            <a href="{{ url_for('front.signin') }}">请先登录</a>
        </div>
        {% endif %}
    </div>
</div>

{% endblock %}